#-*- coding: utf-8 -*-
'''
Created on Jul 21, 2012

@author: bbg
'''
import inspect
import logging
import datetime

class Debug():
    '''
    debug方法
    '''

    def __init__(self, cgi_mode = True):
        self.cgi_mode = cgi_mode
        d = datetime.datetime.now().strftime("%Y%m%d")
        self.log_path = ("/tmp/log/apkservice%s.log" % d)
        if self.cgi_mode is True:
            logging.basicConfig(filename = self.log_path, format = "%(asctime)s %(levelname)s:%(message)s",  datefmt='%Y-%m-%d %H:%M:%S', level = logging.DEBUG)

    def e(self, msg):
        logging.error(msg)
        
    def d(self, msg):
        logging.debug(msg)